Welcome to GeeKee CeeBee's Page: House of Mechatronics Projects & Lessons.
Contact Email: Ceebee1108@gmail.com
Follow me on Youtube
__________________________________________________________________________________________________________________________________
DC Motor Speed Control
Step by step practical guide to speed and position tracking control of a DC motor using Arduino.
Formulate PID theory using Numerical Approximation method.
Write PID code from scratch (Not using pre-written library).
Demonstrate the use of rotary encoders, L298n motor driver, and timer interrupts.
Disclaimer: The code and other information on this project are provided on "AS IS" basis with no warranty. Please follow best practices and assess
your own potential risks for this project.
In this video guide, you will learn how to control speed of any DC motor by controlling the supply voltage. Arduino Uno is used to perform PWM voltage control using the PID controller.
Video covers the encoder implementation, basic PID theory, implementation of Timer Interrupt and External Interrupts, derivation of control law, understanding the discrete methods of calculating
derivative and integration of error. Please watch the whole video for better understanding.
Control Diagram
Rotary encoder feedback signal is used to determine the error speed between the reference speed and the actual motor speed. PID controller
simply controls the amount of voltage needed by the motor using PWM in order to reach the desired output.
Wiring Diagram
Below is the wiring diagram for the components used in this project.
Pin2 and 3 are external ISR pins that trigger by the rotary encoder pulses. Pin6 is the PWM pin to control the amount of voltage sent
to the motor driver. Pin7 and 8 are used to change motor direction by changing the polarity of the supply voltage to the motor.
Make sure there's a common ground between the motor driver, arduino and external power supply.